package com.core.base.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.core.base.mapper.LoginInfoMapper;
import com.core.base.model.LoginInfo;
import com.core.base.service.LoginInfoService;
import com.core.base.util.UserContext;

@Service
public class LoginInfoServiceImpl implements LoginInfoService {
	
	@Autowired
	private LoginInfoMapper loginInfoMapper;
	
	@Override
	public LoginInfo queryLoginInfo(String userName, String password,Integer userType) {
		
		LoginInfo current = loginInfoMapper.queryLoginInfo(userName,password,userType);
		if(current!=null){
			// 存入context中
			UserContext.putCurrent(current);
		}
		return current;
	}

}
